<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
if (!isset($_SESSION)) {
  session_start();
}
define("CCTRL", "log");
define("CCTRLNAME", "log");
define("TOKEN", "1a717d1cea47d99eac724673b90ff970");
include APPPATH . 'libraries/defu.php';
class log extends CI_Controller  {
        function __construct()
        {
            parent::__construct();
            $this->load->helper('url');
            $this->load->model('backend/backend_model');
            $this->backend_model=new backend_model();
            $this->load->library('smarty3');
            $this->smarty=new CI_Smarty3();
            $this->smarty->error_reporting = E_ALL & ~E_NOTICE;
            if(!isset($_SESSION["ADP"][CCTRL]["display"]))$_SESSION["ADP"][CCTRL]["display"]=0;
        }
        function index(){
            if(!checkAuthority(CCTRLNAME,false)){
                $this->smarty
                        ->assign('_SESSION', $_SESSION)
                        ->display("backend/00_accessdenied");
                return;
            }
            $this->smarty
                    ->assign('_SESSION', $_SESSION)
                    ->display("backend/".CCTRL."/log");
        }
        function binding($_table=null){
            $result=$this->backend_model->binding_log($_table);
            $data[] = array(
                'TotalRows' => $result['total_rows'],
                'Rows' => $result['rows']
            );
            echo json_encode($data);
        }
        function handleEvent(){
            header("Content-type:text/javascript");
            $this->smarty->display("backend/".CCTRL."/handleEvent");
        }
}
?>
